package com.daimler.itffo.tables;

import com.daimler.itffo.tables.V0BRB158Pkey;
import com.daimler.itffo.uvs.kern.Baumuster;
import com.daimler.itffo.uvs.kern.Code;

public class V0BRB158Pkey {
	private static final String DEFAULT_AS_LINE = new String("");;

	private static final String MOTORCODE = new String("");;

	private static final String SO_LAND = new String("");;

	private static final String SALES_CODE = new String("");;

	private static final String VON_DAT = new String("");;

	private static final String BIS_DAT = new String("");;

	private Baumuster baum;

	private String asLine;

	private Code motorcode;

	private String soLand;

	private String salesCode;

	private String sprache;

	private String vonDat;

	private String bisDat;

	private Integer kennzId;

	public int compareTo(Object o) {
		V0BRB158Pkey pkey = (V0BRB158Pkey) o;
		int result = 0;

		result = pkey.getBaum().get6DigitsBaumusterWithoutDot()
				.compareTo(this.baum.get6DigitsBaumusterWithoutDot());

		if (result == 0)
			result = pkey.getAsLine().compareTo(this.asLine);

		if (result == 0)
			result = pkey.getAsLine().compareTo(this.asLine);

		if (result == 0)
			result = pkey.getMotorcode().getCode()
					.compareTo(this.motorcode.getCode());

		if (result == 0)
			result = pkey.getSprache().compareTo(this.sprache);
		if (result == 0)
			result = pkey.getKennzId().compareTo(this.kennzId);

		return result;
	}

	public V0BRB158Pkey(V0BRB158Pkey key) {
		super();
		this.baum = key.getBaum();
		this.asLine = key.getAsLine();
		this.motorcode = key.getMotorcode();
		this.soLand = key.getSoLand();
		this.salesCode = key.getSalesCode();
		this.sprache = key.getSprache();
		this.vonDat = key.getVonDat();
		this.bisDat = key.getBisDat();
		this.kennzId = key.getKennzId();
	}

	public V0BRB158Pkey(Baumuster baum, String sprache, Integer kennzId) {
		super();
		this.baum = baum;
		this.asLine = DEFAULT_AS_LINE;
		this.motorcode = new Code(MOTORCODE);
		this.soLand = SO_LAND;
		this.salesCode = SALES_CODE;
		this.sprache = sprache;
		this.vonDat = VON_DAT;
		this.bisDat = BIS_DAT;
		this.kennzId = kennzId;
	}

	public V0BRB158Pkey(Baumuster baum, String asLine, Code motorcode,
			String soLand, String salesCode, String sprache, String vonDat,
			String bisDat, Integer kennzId) {
		super();
		System.out.println("Ich bin key");
		this.baum = baum;
		this.asLine = asLine;
		this.motorcode = motorcode;
		this.soLand = soLand;
		this.salesCode = salesCode;
		this.sprache = sprache;
		this.vonDat = vonDat;
		this.bisDat = bisDat;
		this.kennzId = kennzId;
	}

	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((asLine == null) ? 0 : asLine.hashCode());
		result = PRIME * result + ((bisDat == null) ? 0 : bisDat.hashCode());
		result = PRIME * result
				+ ((motorcode == null) ? 0 : motorcode.hashCode());
		result = PRIME * result
				+ ((salesCode == null) ? 0 : salesCode.hashCode());
		result = PRIME * result + ((soLand == null) ? 0 : soLand.hashCode());
		result = PRIME * result + ((sprache == null) ? 0 : sprache.hashCode());
		result = PRIME * result + ((vonDat == null) ? 0 : vonDat.hashCode());
		result = PRIME * result + ((kennzId == null) ? 0 : kennzId.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final V0BRB158Pkey other = (V0BRB158Pkey) obj;
		if (asLine == null) {
			if (other.asLine != null)
				return false;
		} else if (!asLine.equals(other.asLine))
			return false;
		if (bisDat == null) {
			if (other.bisDat != null)
				return false;
		} else if (!bisDat.equals(other.bisDat))
			return false;
		if (motorcode == null) {
			if (other.motorcode != null)
				return false;
		} else if (!motorcode.equals(other.motorcode))
			return false;
		if (salesCode == null) {
			if (other.salesCode != null)
				return false;
		} else if (!salesCode.equals(other.salesCode))
			return false;
		if (soLand == null) {
			if (other.soLand != null)
				return false;
		} else if (!soLand.equals(other.soLand))
			return false;
		if (sprache == null) {
			if (other.sprache != null)
				return false;
		} else if (!sprache.equals(other.sprache))
			return false;
		if (vonDat == null) {
			if (other.vonDat != null)
				return false;
		} else if (!vonDat.equals(other.vonDat))
			return false;
		if (kennzId == null) {
			if (other.kennzId != null)
				return false;
		} else if (!kennzId.equals(other.kennzId))
			return false;
		return true;
	}

	public String getAsLine() {
		return asLine;
	}

	public Baumuster getBaum() {
		return baum;
	}

	public String getBisDat() {
		return bisDat;
	}

	public Code getMotorcode() {
		return motorcode;
	}

	public String getSalesCode() {
		return salesCode;
	}

	public String getSoLand() {
		return soLand;
	}

	public String getSprache() {
		return sprache;
	}

	public String getVonDat() {
		return vonDat;
	}

	public void setAsLine(String asLine) {
		this.asLine = asLine;
	}

	public void setSprache(String sprache) {
		this.sprache = sprache;
	}

	public void setMotorcode(Code motorcode) {
		this.motorcode = motorcode;
	}

	public Integer getKennzId() {
		return kennzId;
	}

	public void setKennzId(Integer kennzId) {
		this.kennzId = kennzId;
	}

}
